<!--


Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

-->

<div id="cache-groups-outer-container" ng-show="loaded">
    <div id="cacheGroupsOverallHealth">
        <h4 class="cache-groups-online">Cache Groups <small>{{locationHealth.totalOnline/(locationHealth.totalOnline + locationHealth.totalOffline) | percentFilter}} online</small></h4>
        <i class="download-caches-file fa fa-download fa-lg" title="Download Cache Servers" ng-click="downloadCaches()" ng-show="showDownload"></i>
    </div>
    <div id="cacheGroupsContainer">
        <div class="alert alert-info" ng-show="(locationHealth.cachegroups | filter:search:strict).length == 0">
            No matching cache groups
        </div>
        <div class="list-group">
            <a class="cache-group-health list-group-item" ng-repeat="location in locationHealth.cachegroups | orderBy:[onlinePercent, 'name'] | filter:search:strict | offsetFilter:(currentLocationPage-1)*locationsPerPage | limitTo:locationsPerPage">
                <div class="row">
                    <table class="cache-groups-table table">
                        <tbody>
                        <tr>
                            <td class="col-lg-4 col-md-4 col-sm-4">{{location.name}}</td>
                            <td class="col-lg-4 col-md-4 col-sm-4">{{location.online/(location.online + location.offline) | percentFilter}} Online</td>
                            <td class="col-lg-4 col-md-4 col-sm-4">{{location.online}} Servers Online | {{location.offline}} Servers Offline</td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </a>
        </div>
    </div>
    <div>
        <div ng-show="(locationHealth.cachegroups | filter:search:strict).length > 0">
            <uib-pagination class="cache-groups-pagination pagination-md" boundary-links="true" max-size="2" total-items="(locationHealth.cachegroups | filter:search:strict).length" items-per-page="locationsPerPage" ng-model="currentLocationPage" previous-text="&lsaquo;" next-text="&rsaquo;" first-text="&laquo;" last-text="&raquo;"></uib-pagination>
        </div>
        <div class="input-group cache-group-search-form">
            <input type="text" class="filter-input form-control" placeholder="Filter cache groups..." ng-model="search.name">
            <span class="filter-input-group-btn input-group-btn">
                <button class="btn btn-default" type="button"><i class="fa fa-search"></i></button>
            </span>
        </div>
    </div>
</div>
<div id="cacheGroupsLoadingContainer" class="jumbotron loading-text" ng-show="!loaded">Loading cache groups...</div>
